package com.ymttest.database.mongo;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import com.ymt.core.tool.Logger;
import com.ymt.database.MongoDBDriver;

public class ProductDescriptionInfoWapper {
	MongoDBDriver mdd = YmtMongoDriverFactroy.getInstance_YmtProductDBdriver("ProductDescriptionInfo");
	
	 public ProductDescriptionInfoWapper() throws Exception {
	    }
	 
	  
	    public Map<String, Object> getByProductId(String productId) throws Exception {
	        Map<String, Object> scmb = new HashMap<String, Object>();
	        ArrayList<Map> list = mdd.selectPartLimitToMap("{\"ProductId\":\"" + productId + "\"}",1);
	             try {
	            if (list.size() > 0) {
	                scmb = list.get(0);
	                return scmb;
	            }
	        } catch (Exception e) {
	            Logger.debug("err data productId:" + productId);
	            e.printStackTrace();
	        }
	        return null;
	    }
	    
	    
	    public static void main(String[] args) throws Exception {
	    	new ProductDescriptionInfoWapper().getByProductId("7c363285-2d1c-4291-b31e-860be3a8faee");
		}
	 
}
